module.exports = {
    render: function () {
        var _form = icu.templateForm({
            labelwidth: 100,
        });
        _form.$setOptions([
            [{
                key: 'string',
                type: 'input',
                formlabel: '单行文本',
                col: 6,
                verify: {
                    text: '单行文本',
                    rules: ['notNull']
                },
            }, {
                key: 'select',
                type: 'select',
                formlabel: '下拉菜单',
                col: 6,
                data: 'OptionSide:Gender',
                verify: {
                    text: '下拉菜单',
                    rules: 'notNull'
                },
            }], [{
                key: 'inputDate',
                type: 'inputDate',
                formlabel: '日期选择器',
                required: true,
                readonly: true,
            }], [{
                key: 'radio',
                type: 'radio',
                col: 6,
                formlabel: '单选框',
                el: this.$el.find('#radio'),
                data: 'OptionSide:Gender'
            }, {
                key: 'checkBox',
                type: 'checkList',
                col: 6,
                formlabel: '多选框',
                checkAll: false,
                getType: ',',
                data: 'OptionSide:Gender'
            },], [{
                key: 'textarea',
                formlabel: '多行文本',
                col: 12,
                type: 'textarea',
            }], [{
                key: 'CKeditor',
                formlabel: '富文本编辑器',
                type: 'CKeditor',
                col: 12,
            }]
        ]);

        this.$el.find('#form').append(_form.$html);

        this.$el.find('#getEvent').click(() => {
            _form.get(function (value) {
                icu.alert.normal({
                    text: JSON.stringify(value, '<br>')
                })
            });
        });
        this.$el.find('#setEvent').click(() => {
            _form.set({
                a: '123',
                bb: 'qwe',
                cc: 'asd',
                ccc: 'zxc',
                string: 'string',
                select: 0,
            });
        });
    }
}